﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IWMAG.Scripting.Interpreter {
    // emulates out parameters in iterators
    public class Reference<T> {
        public T ReferencedValue;

        public Reference(T val) {
            ReferencedValue = val;
        }

        public void Set(T val) {
            ReferencedValue = val;
        }

        public static implicit operator T(Reference<T> me) {
            return me.ReferencedValue;
        }

        public static implicit operator Reference<T>(T me) {
            return new Reference<T>(me);
        }
    }
}
